﻿  using Abp.Application.Editions;
using Abp.Application.Features;
using Abp.Auditing;
using Abp.Authorization;
using Abp.Authorization.Users;
using Abp.EntityHistory;
using Abp.Localization;
using Abp.Notifications;
using Abp.Organizations;
using Abp.UI.Inputs;
using AutoMapper;
using Camc.Quality.Auditing.Dto;
using Camc.Quality.Authorization.Accounts.Dto;
using Camc.Quality.Authorization.Permissions.Dto;
using Camc.Quality.Authorization.Roles;
using Camc.Quality.Authorization.Roles.Dto;
using Camc.Quality.Authorization.Users;
using Camc.Quality.Authorization.Users.Dto;
using Camc.Quality.Authorization.Users.Importing.Dto;
using Camc.Quality.Authorization.Users.Profile.Dto;
using Camc.Quality.Bom;
using Camc.Quality.Bom.Dto;
using Camc.Quality.BomChange;
using Camc.Quality.BomChange.Dto;
using Camc.Quality.BomMake;
using Camc.Quality.BomMake.Dto;
using Camc.Quality.Bop;
using Camc.Quality.Bop.Dto;
using Camc.Quality.Bop.QualityDto;
using Camc.Quality.Bop.UnifyDto;
using Camc.Quality.Business;
using Camc.Quality.Chat;
using Camc.Quality.Chat.Dto;
using Camc.Quality.CodeFormat;
using Camc.Quality.DataDictionary;
using Camc.Quality.Dto;
using Camc.Quality.Dto.ChangeRecordEntityDto;
using Camc.Quality.Dto.ProcessesEntityDto;
using Camc.Quality.Dto.QualityPlatformDto;
using Camc.Quality.Dto.TableDto;
using Camc.Quality.Dto.TableDto.BopDto.Substance;
using Camc.Quality.Dto.TableDto.RbopDto;
using Camc.Quality.Dto.TableOutDto;
using Camc.Quality.Dto.TableReturnDto.Technique;
using Camc.Quality.Dto.TechniqueEntityDto;
using Camc.Quality.Dto.ZuoYeReturnDto;
using Camc.Quality.Editions;
using Camc.Quality.Editions.Dto;
using Camc.Quality.FilesTransfer;
using Camc.Quality.FormColRelation;
using Camc.Quality.FormRelation;
using Camc.Quality.Friendships;
using Camc.Quality.Friendships.Cache;
using Camc.Quality.Friendships.Dto;
using Camc.Quality.Inspection;
using Camc.Quality.Inspection.InspectionBoard;
using Camc.Quality.Inspection.InspectionManage;
using Camc.Quality.Inspection.InspectionStrat;
using Camc.Quality.Instruction;
using Camc.Quality.Instruction.InstructionForm;
using Camc.Quality.InstructionDto;
using Camc.Quality.InstructionDto.Dto;
using Camc.Quality.InstructionDto.RDto;
using Camc.Quality.Localization.Dto;
using Camc.Quality.Materials;
using Camc.Quality.Materials.Dto;
using Camc.Quality.MultiTenancy;
using Camc.Quality.MultiTenancy.Dto;
using Camc.Quality.MultiTenancy.HostDashboard.Dto;
using Camc.Quality.MultiTenancy.Payments;
using Camc.Quality.MultiTenancy.Payments.Dto;
using Camc.Quality.Notifications.Dto;
using Camc.Quality.OperationHistory;
using Camc.Quality.Organizations.Dto;
using Camc.Quality.ProcessRoute;
using Camc.Quality.ProductionControl;
using Camc.Quality.ProductionPlan;
using Camc.Quality.Quality;
using Camc.Quality.QualityAnalysis.BasicInfoTable;
using Camc.Quality.QualityAnalysis.RFormBase;
using Camc.Quality.QualityAnalysis.RFormClass;
using Camc.Quality.QualityAnalysis.RTechniqueEntity;
using Camc.Quality.QualityManage;
using Camc.Quality.RecordTable.FormBase;
using Camc.Quality.RecordTable.FormClass;
using Camc.Quality.RecordTable.FormEntity;
using Camc.Quality.Sessions.Dto;
using Camc.Quality.StoreManagement;
using Camc.Quality.StoreManagement.Dto;
using Camc.Quality.StoreManagement.StoragePut;
using Camc.Quality.StoreManagement.StoragePut.Dto;
using Camc.Quality.StoreManagement.StoreInfo;
using Camc.Quality.TimeSetting;
using Camc.Quality.Tooling;
using Camc.Quality.Tooling.Dto;
using Camc.Quality.TrepanningManager.BomAnalyse;
using Camc.Quality.TrepanningManager.BomAnalyseDto;
using Camc.Quality.TrepanningManager.CollectBom;
using Camc.Quality.TrepanningManager.CollectBomDto;
using Camc.Quality.TrepanningManager.MatingManager;
using Camc.Quality.TrepanningManager.PrintLabelManager;
using Camc.Quality.UserSkillMartix;
using Camc.Quality.WorkFlow;
using System;
using System.ComponentModel;
using System.Reflection;
//using Camc.Quality.InstructionDto.InstructionLogDto;
//using Camc.Quality.InstructionDto.MaterialObjectInfoDto;

namespace Camc.Quality
{
    internal static class CustomDtoMapper
    {
        public static void CreateMappings(IMapperConfigurationExpression configuration)
        {
            //Inputs
            configuration.CreateMap<CheckboxInputType, FeatureInputTypeDto>();
            configuration.CreateMap<SingleLineStringInputType, FeatureInputTypeDto>();
            configuration.CreateMap<ComboboxInputType, FeatureInputTypeDto>();
            configuration.CreateMap<IInputType, FeatureInputTypeDto>()
                .Include<CheckboxInputType, FeatureInputTypeDto>()
                .Include<SingleLineStringInputType, FeatureInputTypeDto>()
                .Include<ComboboxInputType, FeatureInputTypeDto>();
            configuration.CreateMap<StaticLocalizableComboboxItemSource, LocalizableComboboxItemSourceDto>();
            configuration.CreateMap<ILocalizableComboboxItemSource, LocalizableComboboxItemSourceDto>()
                .Include<StaticLocalizableComboboxItemSource, LocalizableComboboxItemSourceDto>();
            configuration.CreateMap<LocalizableComboboxItem, LocalizableComboboxItemDto>();
            configuration.CreateMap<ILocalizableComboboxItem, LocalizableComboboxItemDto>()
                .Include<LocalizableComboboxItem, LocalizableComboboxItemDto>();

            //Chat
            configuration.CreateMap<ChatMessage, ChatMessageDto>();
            configuration.CreateMap<ChatMessage, ChatMessageExportDto>();

            //Feature
            configuration.CreateMap<FlatFeatureSelectDto, Feature>().ReverseMap();
            configuration.CreateMap<Feature, FlatFeatureDto>();

            //Role
            configuration.CreateMap<RoleEditDto, Role>().ReverseMap();
            configuration.CreateMap<Role, RoleListDto>();
            configuration.CreateMap<UserRole, UserListRoleDto>();

            //Edition
            configuration.CreateMap<EditionEditDto, SubscribableEdition>().ReverseMap();
            configuration.CreateMap<EditionCreateDto, SubscribableEdition>();
            configuration.CreateMap<EditionSelectDto, SubscribableEdition>().ReverseMap();
            configuration.CreateMap<SubscribableEdition, EditionInfoDto>();

            configuration.CreateMap<Edition, EditionInfoDto>().Include<SubscribableEdition, EditionInfoDto>();

            configuration.CreateMap<SubscribableEdition, EditionListDto>();
            configuration.CreateMap<Edition, EditionEditDto>();
            configuration.CreateMap<Edition, SubscribableEdition>();
            configuration.CreateMap<Edition, EditionSelectDto>();


            //Payment
            configuration.CreateMap<SubscriptionPaymentDto, SubscriptionPayment>().ReverseMap();
            configuration.CreateMap<SubscriptionPaymentListDto, SubscriptionPayment>().ReverseMap();
            configuration.CreateMap<SubscriptionPayment, SubscriptionPaymentInfoDto>();

            //Permission
            configuration.CreateMap<Permission, FlatPermissionDto>();
            configuration.CreateMap<Permission, FlatPermissionWithLevelDto>();

            //Language
            configuration.CreateMap<ApplicationLanguage, ApplicationLanguageEditDto>();
            configuration.CreateMap<ApplicationLanguage, ApplicationLanguageListDto>();
            configuration.CreateMap<NotificationDefinition, NotificationSubscriptionWithDisplayNameDto>();
            configuration.CreateMap<ApplicationLanguage, ApplicationLanguageEditDto>()
                .ForMember(ldto => ldto.IsEnabled, options => options.MapFrom(l => !l.IsDisabled));

            //Tenant
            configuration.CreateMap<Tenant, RecentTenant>();
            configuration.CreateMap<Tenant, TenantLoginInfoDto>();
            configuration.CreateMap<Tenant, TenantListDto>();
            configuration.CreateMap<TenantEditDto, Tenant>().ReverseMap();
            configuration.CreateMap<CurrentTenantInfoDto, Tenant>().ReverseMap();

            //User
            configuration.CreateMap<User, UserEditDto>()
                .ForMember(dto => dto.Password, options => options.Ignore())
                .ReverseMap()
                .ForMember(user => user.Password, options => options.Ignore());
            configuration.CreateMap<User, UserLoginInfoDto>();
            configuration.CreateMap<User, UserListDto>();
            configuration.CreateMap<User, ChatUserDto>();
            configuration.CreateMap<User, OrganizationUnitUserListDto>();
            configuration.CreateMap<Role, OrganizationUnitRoleListDto>();
            configuration.CreateMap<CurrentUserProfileEditDto, User>().ReverseMap();
            configuration.CreateMap<UserLoginAttemptDto, UserLoginAttempt>().ReverseMap();
            configuration.CreateMap<ImportUserDto, User>();

            //AuditLog
            configuration.CreateMap<AuditLog, AuditLogListDto>();
            configuration.CreateMap<EntityChange, EntityChangeListDto>();

            //Friendship
            configuration.CreateMap<Friendship, FriendDto>();
            configuration.CreateMap<FriendCacheItem, FriendDto>();

            //OrganizationUnit
            configuration.CreateMap<OrganizationUnit, OrganizationUnitDto>();

            //工序

            configuration.CreateMap<ProcessesEntity, ProcessesEntityDto>().ReverseMap();
            configuration.CreateMap<ProcessesDto, ProcessesEntity>().ForMember(t => t.WorkStepEntities, opt => opt.MapFrom(_ => _.WorkStepListDto)).ReverseMap();

            configuration.CreateMap<ProcessesOutDto, ProcessesEntity>().ForMember(t => t.WorkStepEntities, opt => opt.MapFrom(_ => _.WorkStepListDto)).ReverseMap();
            configuration.CreateMap<WorkStepOutDto, WorkStepEntity>().ReverseMap();

            //configuration.CreateMap<RprocessesOutDto, RProcessesEntity>().ForMember(t => t.WorkStepEntities, opt => opt.MapFrom(_ => _.WorkStepListDto)).ReverseMap();
            configuration.CreateMap<WorkStepDto, WorkStepEntity>().ReverseMap();
            configuration.CreateMap<RWorkStepEntity, RworkStepOutDto>().ReverseMap();

            configuration.CreateMap<RProcessesEntity, RprocessesDto>().ReverseMap();
            configuration.CreateMap<RprocessesOutDto, RProcessesEntity>().ForMember(t => t.WorkStepEntities, opt => opt.MapFrom(_ => _.WorkStepListDto)).ReverseMap();
            //configuration.CreateMap<WorkStepOutDto, WorkStepEntity>().ReverseMap();


            //工艺文件
            configuration.CreateMap<TechniqueEntity, TechniqueEntityReturnDto>().ReverseMap();
            configuration.CreateMap<TechniqueDto, TechniqueEntity>().ForMember(t => t.ProcessesEntities, opt => opt.MapFrom(_ => _.ProcessesListDto)).ReverseMap();
            configuration.CreateMap<TechniqueOutDto, TechniqueEntity>().ForMember(t => t.ProcessesEntities, opt => opt.MapFrom(_ => _.ProcessesListDto)).ReverseMap();
            configuration.CreateMap<TechniqueEntity, TechniqueDto>().ForMember(t => t.ProcessesListDto, opt => opt.MapFrom(_ => _.ProcessesEntities))
            .ForMember(d => d.StageSignDesc, opt => opt.MapFrom(s => GetEnumDesc(s.StageSign))).ForMember(d => d.TechniqueTypeDesc, opt => opt.MapFrom(s => GetEnumDesc(s.TechniqueType)))
            .ForMember(d => d.ShapeDesc, opt => opt.MapFrom(s => GetEnumDesc(s.Shape))).ForMember(d => d.SecretDegreeDesc, opt => opt.MapFrom(s => GetEnumDesc(s.SecretDegree)));
            //更改表
            configuration.CreateMap<ChangeRecordDto, ChangeRecordEntity>().ReverseMap();
            //实体表

            configuration.CreateMap<LoadPieceEntity, InsertDetailsDto>().ReverseMap();
            configuration.CreateMap<MakeResourcesEntity, ManufacturingResourcesDto>().ReverseMap();
            configuration.CreateMap<VideoEntity, VideoFrequencyDto>().ReverseMap();

            configuration.CreateMap<RLoadPieceEntity, RInsertDetailsDto>().ReverseMap();
            configuration.CreateMap<RMakeResourcesEntity, RManufacturingResourcesDto>().ReverseMap();
            configuration.CreateMap<RVideoEntity, RVideoFrequencyDto>().ReverseMap();

            //返回表
            configuration.CreateMap<TechniqueReturnDto, RTechniqueEntity>().ForMember(t => t.ProcessesEntities, opt => opt.MapFrom(_ => _.ProcessesListDto)).ReverseMap();
            configuration.CreateMap<ProcessesReturnDto, RProcessesEntity>().ForMember(t => t.WorkStepEntities, opt => opt.MapFrom(_ => _.WorkStepListDto)).ReverseMap();
            configuration.CreateMap<WorkStepReturnDto, RWorkStepEntity>().ReverseMap();
            configuration.CreateMap<RVideoFrequencyDtos, RVideoEntity>().ReverseMap();
            configuration.CreateMap<RManufacturingResourcesDtos, RMakeResourcesEntity>().ReverseMap();
            configuration.CreateMap<RInsertDetailsDtos, RLoadPieceEntity>().ReverseMap();
            configuration.CreateMap<RTechniqueEntity, RTechniqueOutDto>().ReverseMap();
            //表

            //新6表
            #region R电连接器插接多媒体记录表
            configuration.CreateMap<RTableBase, RMultimediaElectricalConnectDto>()
            .ForMember(d => d.PhotoNo, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo))
            .ForMember(d => d.PhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo_DisplayName))
            .ForMember(d => d.SecondPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.SecondPhotoNo))
            .ForMember(d => d.SecondPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.SecondPhotoNo_DisplayName))
            .ForMember(d => d.ThirdPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.ThirdPhotoNo))
            .ForMember(d => d.ThirdPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.ThirdPhotoNo_DisplayName))
            .ForMember(d => d.FourthPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.FourthPhotoNo))
            .ForMember(d => d.FourthPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.FourthPhotoNo_DisplayName))
            .ForMember(d => d.InspectionSignatureName, opt => opt.MapFrom(s => s.InspectionSignature.InspectionSignatureName))
            .ForMember(d => d.FirstOperator, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator))
            .ForMember(d => d.FirstOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator_DisplayName))
            .ForMember(d => d.FirstOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData))
            .ForMember(d => d.FirstOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData_DisplayName))
            .ForMember(d => d.SecondOperator, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator))
            .ForMember(d => d.SecondOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator_DisplayName))
            .ForMember(d => d.SecondOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData))
            .ForMember(d => d.SecondOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData_DisplayName))
            .ForMember(d => d.ThirdOperator, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator))
            .ForMember(d => d.ThirdOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator_DisplayName))
            .ForMember(d => d.ThirdOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData))
            .ForMember(d => d.ThirdOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData_DisplayName));
            #endregion
            #region R仪器安装电缆余量多媒体记录表
            configuration.CreateMap<RTableBase, RInstrumentCableAllowanceDto>()
            .ForMember(d => d.FirstMeasuredValues, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues))
            .ForMember(d => d.FirstMeasuredValues_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues_DisplayName))
            .ForMember(d => d.PhotoNo, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo))
            .ForMember(d => d.PhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo_DisplayName))
            .ForMember(d => d.InspectionSignatureName, opt => opt.MapFrom(s => s.InspectionSignature.InspectionSignatureName))
            .ForMember(d => d.FirstOperator, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator))
            .ForMember(d => d.FirstOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator_DisplayName))
            .ForMember(d => d.FirstOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData))
            .ForMember(d => d.FirstOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData_DisplayName))
            .ForMember(d => d.SecondOperator, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator))
            .ForMember(d => d.SecondOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator_DisplayName))
            .ForMember(d => d.SecondOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData))
            .ForMember(d => d.SecondOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData_DisplayName))
            .ForMember(d => d.ThirdOperator, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator))
            .ForMember(d => d.ThirdOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator_DisplayName))
            .ForMember(d => d.ThirdOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData))
            .ForMember(d => d.ThirdOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData_DisplayName));
            #endregion
            #region R仪器安装分离钢索多媒体记录表
            configuration.CreateMap<RTableBase, RInstrumentSeparationCableDto>()
            .ForMember(d => d.FirstMeasuredValues, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues))
            .ForMember(d => d.FirstMeasuredValues_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues_DisplayName))
            .ForMember(d => d.PhotoNo, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo))
            .ForMember(d => d.PhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo_DisplayName))
            .ForMember(d => d.InspectionSignatureName, opt => opt.MapFrom(s => s.InspectionSignature.InspectionSignatureName))
            .ForMember(d => d.FirstOperator, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator))
            .ForMember(d => d.FirstOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator_DisplayName))
            .ForMember(d => d.FirstOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData))
            .ForMember(d => d.FirstOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData_DisplayName))
            .ForMember(d => d.SecondOperator, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator))
            .ForMember(d => d.SecondOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator_DisplayName))
            .ForMember(d => d.SecondOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData))
            .ForMember(d => d.SecondOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData_DisplayName))
            .ForMember(d => d.ThirdOperator, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator))
            .ForMember(d => d.ThirdOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator_DisplayName))
            .ForMember(d => d.ThirdOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData))
            .ForMember(d => d.ThirdOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData_DisplayName));
            #endregion
            #region R仪器安装分离力测试多媒体记录表
            configuration.CreateMap<RTableBase, RInstrumentSeparationForceTestDto>()
            .ForMember(d => d.FirstMeasuredValues, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues))
            .ForMember(d => d.FirstMeasuredValues_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues_DisplayName))
            .ForMember(d => d.PhotoNo, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo))
            .ForMember(d => d.PhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo_DisplayName))
            .ForMember(d => d.InspectionSignatureName, opt => opt.MapFrom(s => s.InspectionSignature.InspectionSignatureName))
            .ForMember(d => d.FirstOperator, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator))
            .ForMember(d => d.FirstOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator_DisplayName))
            .ForMember(d => d.FirstOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData))
            .ForMember(d => d.FirstOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData_DisplayName))
            .ForMember(d => d.SecondOperator, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator))
            .ForMember(d => d.SecondOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator_DisplayName))
            .ForMember(d => d.SecondOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData))
            .ForMember(d => d.SecondOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData_DisplayName))
            .ForMember(d => d.ThirdOperator, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator))
            .ForMember(d => d.ThirdOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator_DisplayName))
            .ForMember(d => d.ThirdOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData))
            .ForMember(d => d.ThirdOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData_DisplayName));
            #endregion
            #region R仪器安装力矩记录表
            configuration.CreateMap<RTableBase, RInstrumentTorqueRecordDto>()
            .ForMember(d => d.DesignerDemand, opt => opt.MapFrom(s => s.RecordRequirements.DesignerDemand))
            .ForMember(d => d.DesignerDemand_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.DesignerDemand_DisplayName))
            .ForMember(d => d.ProcessorDemand, opt => opt.MapFrom(s => s.RecordRequirements.ProcessorDemand))
            .ForMember(d => d.ProcessorDemand_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.ProcessorDemand_DisplayName))
            .ForMember(d => d.Remarks, opt => opt.MapFrom(s => s.RecordRequirements.Remarks))
            .ForMember(d => d.Remarks_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.Remarks_DisplayName))
            .ForMember(d => d.FirstMeasuredValues, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues))
            .ForMember(d => d.FirstMeasuredValues_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues_DisplayName))
            .ForMember(d => d.InspectionSignatureName, opt => opt.MapFrom(s => s.InspectionSignature.InspectionSignatureName))
            .ForMember(d => d.FirstOperator, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator))
            .ForMember(d => d.FirstOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator_DisplayName))
            .ForMember(d => d.FirstOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData))
            .ForMember(d => d.FirstOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData_DisplayName))
            .ForMember(d => d.SecondOperator, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator))
            .ForMember(d => d.SecondOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator_DisplayName))
            .ForMember(d => d.SecondOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData))
            .ForMember(d => d.SecondOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData_DisplayName))
            .ForMember(d => d.ThirdOperator, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator))
            .ForMember(d => d.ThirdOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator_DisplayName))
            .ForMember(d => d.ThirdOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData))
            .ForMember(d => d.ThirdOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData_DisplayName));
            #endregion
            #region R仪器插座安装多媒体记录表
            configuration.CreateMap<RTableBase, RMultimediaSheetSocketDto>()
            .ForMember(d => d.FirstMeasuredValues, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues))
            .ForMember(d => d.FirstMeasuredValues_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues_DisplayName))
            .ForMember(d => d.PhotoNo, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo))
            .ForMember(d => d.PhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo_DisplayName))
            .ForMember(d => d.InspectionSignatureName, opt => opt.MapFrom(s => s.InspectionSignature.InspectionSignatureName))
            .ForMember(d => d.FirstOperator, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator))
            .ForMember(d => d.FirstOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator_DisplayName))
            .ForMember(d => d.FirstOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData))
            .ForMember(d => d.FirstOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData_DisplayName))
            .ForMember(d => d.SecondOperator, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator))
            .ForMember(d => d.SecondOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator_DisplayName))
            .ForMember(d => d.SecondOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData))
            .ForMember(d => d.SecondOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData_DisplayName))
            .ForMember(d => d.ThirdOperator, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator))
            .ForMember(d => d.ThirdOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator_DisplayName))
            .ForMember(d => d.ThirdOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData))
            .ForMember(d => d.ThirdOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData_DisplayName));
            #endregion

            #region 
            configuration.CreateMap<TableBase, GetZuoYeDetailDataOutput>()
             .ForMember(d => d.DesignerDemand, opt => opt.MapFrom(s => s.RecordRequirements.DesignerDemand))
            .ForMember(d => d.DesignerDemand_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.DesignerDemand_DisplayName))
            .ForMember(d => d.ProcessorDemand, opt => opt.MapFrom(s => s.RecordRequirements.ProcessorDemand))
            .ForMember(d => d.ProcessorDemand_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.ProcessorDemand_DisplayName))
            .ForMember(d => d.Remarks, opt => opt.MapFrom(s => s.RecordRequirements.Remarks))
            .ForMember(d => d.Remarks_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.Remarks_DisplayName))
            .ForMember(d => d.FirstMeasuredValues, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues))
            .ForMember(d => d.FirstMeasuredValues_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues_DisplayName))
            .ForMember(d => d.PhotoNo, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo))
            .ForMember(d => d.PhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo_DisplayName))
            .ForMember(d => d.SecondPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.SecondPhotoNo))
            .ForMember(d => d.SecondPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.SecondPhotoNo_DisplayName))
            .ForMember(d => d.ThirdPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.ThirdPhotoNo))
            .ForMember(d => d.ThirdPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.ThirdPhotoNo_DisplayName))
            .ForMember(d => d.FourthPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.FourthPhotoNo))
            .ForMember(d => d.FourthPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.FourthPhotoNo_DisplayName))
            .ForMember(d => d.FirstOperator, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator))
            .ForMember(d => d.FirstOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator_DisplayName))
            .ForMember(d => d.FirstOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData))
            .ForMember(d => d.FirstOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData_DisplayName))
            .ForMember(d => d.SecondOperator, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator))
            .ForMember(d => d.SecondOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator_DisplayName))
            .ForMember(d => d.SecondOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData))
            .ForMember(d => d.SecondOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData_DisplayName))
            .ForMember(d => d.ThirdOperator, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator))
            .ForMember(d => d.ThirdOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator_DisplayName))
            .ForMember(d => d.ThirdOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData))
            .ForMember(d => d.ThirdOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData_DisplayName));
            #endregion 
            #region 
            configuration.CreateMap<RTableBase, GetZuoYeDetailDataOutput>()
             .ForMember(d => d.DesignerDemand, opt => opt.MapFrom(s => s.RecordRequirements.DesignerDemand))
            .ForMember(d => d.DesignerDemand_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.DesignerDemand_DisplayName))
            .ForMember(d => d.ProcessorDemand, opt => opt.MapFrom(s => s.RecordRequirements.ProcessorDemand))
            .ForMember(d => d.ProcessorDemand_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.ProcessorDemand_DisplayName))
            .ForMember(d => d.Remarks, opt => opt.MapFrom(s => s.RecordRequirements.Remarks))
            .ForMember(d => d.Remarks_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.Remarks_DisplayName))
            .ForMember(d => d.FirstMeasuredValues, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues))
            .ForMember(d => d.FirstMeasuredValues_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues_DisplayName))
            .ForMember(d => d.PhotoNo, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo))
            .ForMember(d => d.PhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo_DisplayName))
            .ForMember(d => d.SecondPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.SecondPhotoNo))
            .ForMember(d => d.SecondPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.SecondPhotoNo_DisplayName))
            .ForMember(d => d.ThirdPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.ThirdPhotoNo))
            .ForMember(d => d.ThirdPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.ThirdPhotoNo_DisplayName))
            .ForMember(d => d.FourthPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.FourthPhotoNo))
            .ForMember(d => d.FourthPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.FourthPhotoNo_DisplayName))
            .ForMember(d => d.FirstOperator, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator))
            .ForMember(d => d.FirstOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator_DisplayName))
            .ForMember(d => d.FirstOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData))
            .ForMember(d => d.FirstOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData_DisplayName))
            .ForMember(d => d.SecondOperator, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator))
            .ForMember(d => d.SecondOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator_DisplayName))
            .ForMember(d => d.SecondOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData))
            .ForMember(d => d.SecondOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData_DisplayName))
            .ForMember(d => d.ThirdOperator, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator))
            .ForMember(d => d.ThirdOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator_DisplayName))
            .ForMember(d => d.ThirdOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData))
            .ForMember(d => d.ThirdOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData_DisplayName));
            #endregion

            #region RTableBase-RTableBasesOutDto
            configuration.CreateMap<RTableBase, RTableBasesOutDto>().ForMember(d => d.PhotoNo, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo))
            .ForMember(d => d.PhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo_DisplayName))
            .ForMember(d => d.SecondPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.SecondPhotoNo))
            .ForMember(d => d.SecondPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.SecondPhotoNo_DisplayName))
            .ForMember(d => d.ThirdPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.ThirdPhotoNo))
            .ForMember(d => d.ThirdPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.ThirdPhotoNo_DisplayName))
            .ForMember(d => d.FourthPhotoNo, opt => opt.MapFrom(s => s.MultiMedia.FourthPhotoNo))
            .ForMember(d => d.FourthPhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.FourthPhotoNo_DisplayName))
            .ForMember(d => d.RecordLocation, opt => opt.MapFrom(s => s.RecordRequirements.RecordLocation))
            .ForMember(d => d.RecordLocation_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.RecordLocation_DisplayName))
            .ForMember(d => d.RecordRequire, opt => opt.MapFrom(s => s.RecordRequirements.RecordRequire))
            .ForMember(d => d.RecordRequire_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.RecordRequire_DisplayName))
            .ForMember(d => d.RecordStatus, opt => opt.MapFrom(s => s.RecordRequirements.RecordStatus))
            .ForMember(d => d.RecordStatus_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.RecordStatus_DisplayName))

            .ForMember(d => d.RecordMainopoint, opt => opt.MapFrom(s => s.RecordRequirements.RecordMainopoint))
            .ForMember(d => d.RecordMainopoint_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.RecordMainopoint_DisplayName))

            .ForMember(d => d.DesignerDemand, opt => opt.MapFrom(s => s.RecordRequirements.DesignerDemand))
            .ForMember(d => d.DesignerDemand_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.DesignerDemand_DisplayName))


            .ForMember(d => d.ProcessorDemand, opt => opt.MapFrom(s => s.RecordRequirements.ProcessorDemand))
            .ForMember(d => d.ProcessorDemand_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.DesignerDemand_DisplayName))


            .ForMember(d => d.Remarks, opt => opt.MapFrom(s => s.RecordRequirements.Remarks))
            .ForMember(d => d.Remarks_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.Remarks_DisplayName))

            .ForMember(d => d.FirstConfirmResult, opt => opt.MapFrom(s => s.MeasuredResult.FirstConfirmResult))
            .ForMember(d => d.FirstConfirmResult_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.FirstConfirmResult_DisplayName))
            .ForMember(d => d.InspectionSignatureName, opt => opt.MapFrom(s => s.InspectionSignature.InspectionSignatureName))
            .ForMember(d => d.FirstOperator, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator))
            .ForMember(d => d.FirstOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator_DisplayName))
            .ForMember(d => d.FirstOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData.ToString()))
            .ForMember(d => d.FirstOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData_DisplayName))
            .ForMember(d => d.SecondOperator, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator))
            .ForMember(d => d.SecondOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator_DisplayName))
            .ForMember(d => d.SecondOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData.ToString()))
            .ForMember(d => d.SecondOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData_DisplayName))
            .ForMember(d => d.ThirdOperator, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator))
            .ForMember(d => d.ThirdOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator_DisplayName))
            .ForMember(d => d.ThirdOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData.ToString()))
            .ForMember(d => d.ThirdOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData_DisplayName))
            .ForMember(d => d.FirstMeasuredValues, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues))
            .ForMember(d => d.FirstMeasuredValues_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.FirstMeasuredValues_DisplayName))
            .ForMember(d => d.SecondMeasuredValues, opt => opt.MapFrom(s => s.MeasuredResult.SecondMeasuredValues))
            .ForMember(d => d.SecondMeasuredValues_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.SecondMeasuredValues_DisplayName))
            .ForMember(d => d.ThirdMeasuredValues, opt => opt.MapFrom(s => s.MeasuredResult.ThirdMeasuredValues))
            .ForMember(d => d.ThirdMeasuredValues_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.ThirdMeasuredValues_DisplayName))
            .ForMember(d => d.FourthMeasuredValues, opt => opt.MapFrom(s => s.MeasuredResult.FourthMeasuredValues))
            .ForMember(d => d.FourthMeasuredValues_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.FourthMeasuredValues_DisplayName)); ;
            #endregion


            #region RTableBase-通用多媒体记录表（汇总）
            configuration.CreateMap<RTableBase, MultiMediaExportDto>().ForMember(d => d.PhotoNo, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo))
            .ForMember(d => d.PhotoNo_DisplayName, opt => opt.MapFrom(s => s.MultiMedia.PhotoNo_DisplayName))
            .ForMember(d => d.RecordLocation, opt => opt.MapFrom(s => s.RecordRequirements.RecordLocation))
            .ForMember(d => d.RecordLocation_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.RecordLocation_DisplayName))
            .ForMember(d => d.RecordRequire, opt => opt.MapFrom(s => s.RecordRequirements.RecordRequire))
            .ForMember(d => d.RecordRequire_DisplayName, opt => opt.MapFrom(s => s.RecordRequirements.RecordRequire_DisplayName))
            .ForMember(d => d.FirstConfirmResult, opt => opt.MapFrom(s => s.MeasuredResult.FirstConfirmResult))
            .ForMember(d => d.FirstConfirmResult_DisplayName, opt => opt.MapFrom(s => s.MeasuredResult.FirstConfirmResult_DisplayName))
            .ForMember(d => d.InspectionSignatureName, opt => opt.MapFrom(s => s.InspectionSignature.InspectionSignatureName))
            .ForMember(d => d.FirstOperator, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator))
            .ForMember(d => d.FirstOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperator_DisplayName))
            .ForMember(d => d.FirstOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData.ToString()))
            .ForMember(d => d.FirstOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.FirstOperatorData_DisplayName))
            .ForMember(d => d.SecondOperator, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator))
            .ForMember(d => d.SecondOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperator_DisplayName))
            .ForMember(d => d.SecondOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData.ToString()))
            .ForMember(d => d.SecondOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.SecondOperatorData_DisplayName))
            .ForMember(d => d.ThirdOperator, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator))
            .ForMember(d => d.ThirdOperator_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperator_DisplayName))
            .ForMember(d => d.ThirdOperatorData, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData.ToString()))
            .ForMember(d => d.ThirdOperatorData_DisplayName, opt => opt.MapFrom(s => s.InspectionSignature.ThirdOperatorData_DisplayName));
            #endregion

            configuration.CreateMap<MultiMediaDto, MultiMediaEntity>().ReverseMap();
            configuration.CreateMap<TransducerConverterDto, TransducerConverter>().ReverseMap();

            //取数据表
            configuration.CreateMap<MultiMediaOutDto, MultiMediaEntity>().ReverseMap();//多媒体
            configuration.CreateMap<MomentRecordOutDto, 通用力矩复校记录表>().ReverseMap();
            configuration.CreateMap<MomentOutDto, 力矩记录表>().ReverseMap();
            configuration.CreateMap<HatchOutDto, 舱口盖开闭记录表>().ReverseMap();
            configuration.CreateMap<LoadPieceOutDto, LoadPieceEntity>().ReverseMap();
            configuration.CreateMap<MultiMediaOutDto, MultiMediaEntity>().ReverseMap();
            configuration.CreateMap<TransducerConverterOutDto, TransducerConverter>().ReverseMap();
            configuration.CreateMap<VideoOutDto, VideoEntity>().ReverseMap();
            configuration.CreateMap<ZZResourcesOutDto, MakeResourcesEntity>().ReverseMap();
            //bop任务
            configuration.CreateMap<BopDescDto, BopDesc>().ReverseMap();
            configuration.CreateMap<BopDesc, BopDescDto>().ReverseMap();
            configuration.CreateMap<BopDesc, BopDescOutput>().ReverseMap();
            
            configuration.CreateMap<BopDescEditDto, BopDesc>().ReverseMap();
            configuration.CreateMap<BopDesc, BopDescEditDto>().ReverseMap();
            configuration.CreateMap<BopDesc, BomMakeContentDto>().ReverseMap();
            configuration.CreateMap<BopDesc, BopDescDto>().ForMember(d => d.StatusDesc, opt => opt.MapFrom(s => ((Status)(s.Status)).ToString()))
                                                          .ForMember(d => d.QualityStatusDesc, opt => opt.MapFrom(s => ((QualityStatus)(s.QualityStatus)).ToString()));

            configuration.CreateMap<RbopDesc, RbopDescDto>().ForMember(d => d.StatusDesc, opt => opt.MapFrom(s => ((Status)(s.Status)).ToString()))
                                                        .ForMember(d => d.QualityStatusDesc, opt => opt.MapFrom(s => ((QualityStatus)(s.QualityStatus)).ToString()));
            configuration.CreateMap<BopDesc, RbopDesc>().ReverseMap();
            configuration.CreateMap<RbopDesc, RbopDescOutput>().ForMember(d => d.StatusDesc, opt => opt.MapFrom(s => ((Status)(s.Status)).ToString()))
                                                      .ForMember(d => d.QualityStatusDesc, opt => opt.MapFrom(s => ((QualityStatus)(s.QualityStatus)).ToString()));
            
            configuration.CreateMap<BopNode, RbopNode>().ForMember(d => d.RbopDescId, opt => opt.MapFrom(s => s.BopDescId));
            configuration.CreateMap<BopContent, RbopContent>().ForMember(d => d.RbopNodeId, opt => opt.MapFrom(s => s.BopNodeId));
            //节点
            configuration.CreateMap<BopNodeEditDto, BopNode>().ReverseMap();
            configuration.CreateMap<RbopNode, RbopNodeDto>().ReverseMap();
            configuration.CreateMap<BopNode, BopNodeEditDto>().ReverseMap();
            configuration.CreateMap<BopDesc, RnodeDescDto>().ReverseMap();


            //bop 文件查询
            configuration.CreateMap<ProcessFileDto, TechniqueEntity>().ReverseMap();
            configuration.CreateMap<TechniqueEntity, ProcessFileDto>().ReverseMap();

            //Pad
            configuration.CreateMap<FileTransferDto, FileTransfer>().ReverseMap();
            configuration.CreateMap<FileTransfer, FileTransferDto>().ReverseMap();

            //部套信息
            configuration.CreateMap<BopContent, BopContentEditDto>().ReverseMap();
            configuration.CreateMap<BopContentEditDto, BopContent>().ReverseMap();
            //Bop模块工序
            configuration.CreateMap<QualityProcessesDto, ProcessesEntity>().ReverseMap();
            configuration.CreateMap<QualityWorkStepDto, WorkStepEntity>().ReverseMap();

            configuration.CreateMap<BopDesc, BopTaskOutDto>().ReverseMap();
            configuration.CreateMap<ProcessesEntity, WorkStepAndProcessDto>().ReverseMap();
            configuration.CreateMap<RProcessesEntity, PQualitWorkStepDto>().ReverseMap();

            //操作履历
            configuration.CreateMap<OperationLog, OperationLogDto>().ReverseMap();
            configuration.CreateMap<OperationLogDto, OperationLog>().ReverseMap();
            configuration.CreateMap<OperationLog, OperationLogDto>().ForMember(d => d.OperationTypeDesc, opt => opt.MapFrom(s => ((OperationTypes)(s.OperationType)).ToString()))
                                                                    .ForMember(d => d.BusinessTypeDesc, opt => opt.MapFrom(s => ((BusinessTypes)(s.BusinessType)).ToString()));

            //质量中台
            configuration.CreateMap<AnalysisTableInforDto, AnalysisTableInfor>().ReverseMap();
            configuration.CreateMap<AnalysisTableInfor, AnalysisTableInforDto>().ReverseMap();
            configuration.CreateMap<RTechniqueEntity, RTechFileHeaderDto>().ForMember(d => d.StageSignDesc, opt => opt.MapFrom(s => GetEnumDesc(s.StageSign))).ForMember(d => d.TechniqueTypeDesc, opt => opt.MapFrom(s => GetEnumDesc(s.TechniqueType)))
            .ForMember(d => d.ShapeDesc, opt => opt.MapFrom(s => GetEnumDesc(s.Shape))).ForMember(d => d.SecretDegreeDesc, opt => opt.MapFrom(s => GetEnumDesc(s.SecretDegree)));

            //一体化文件管理
            configuration.CreateMap<TechniqueEntity, BopUnifyDto>().ForMember(d => d.StageSignDesc, opt => opt.MapFrom(s => GetEnumDesc(s.StageSign)));
            configuration.CreateMap<RouteDic, RManufacturingResourcesDto>().ReverseMap();
            //数据字典
            configuration.CreateMap<SysCodeDto, Sys_Code>().ReverseMap();
            //物料建模
            configuration.CreateMap<MaterialsDescDto, MaterialsDesc>().ReverseMap();
            //物料详细内容
            configuration.CreateMap<MaterialsContentDto, MaterialsContent>().ReverseMap();
            configuration.CreateMap<MaterialsContent, MaterialsContentDto>().ReverseMap();
            configuration.CreateMap<MaterialsContent, MaterialsEditContentDto>().ReverseMap();

            #region Bom相关
            configuration.CreateMap<BomDesignDto, BomDesign>().ReverseMap();
            configuration.CreateMap<BomDesignDetailDto, BomDesignDetail>().ReverseMap();
            configuration.CreateMap<BomChangeContentDto, BomChangeContent>().ReverseMap();
            configuration.CreateMap<BomChangeUpdateDto, BomChangeContent>().ReverseMap();
            configuration.CreateMap<BomMakeContentDto, BomMakeContent>().ReverseMap();
            #endregion
            #region 工装夹具相关
            configuration.CreateMap<ToolingNodeDto, ToolingNode>().ReverseMap();
            configuration.CreateMap<ToolingContentDto, ToolingContent>().ReverseMap();
            #endregion
            #region 仓库消息相关
            configuration.CreateMap<StoreContentDto, StoreContent>().ReverseMap();
            #endregion
            #region 仓库管理相关
            configuration.CreateMap<StorePutModelContentDto, StorePutContent>().ReverseMap();
            configuration.CreateMap<StoreStockContentDto, StoreStockContent>().ReverseMap();
            #endregion
            #region 齐套料管理
            configuration.CreateMap<CollectBomManagerDto, CollectBomManager>().ReverseMap();
            configuration.CreateMap<BomAnalyseContentDto, BomAnalyseContent>().ReverseMap();
            configuration.CreateMap<BomAnalyseContent, BomAnalyseContentDto>().ReverseMap();
            configuration.CreateMap<MatingEditParentData, MatingEditChildData>().ReverseMap();
            configuration.CreateMap<MatingEditChildData, MatingEditParentData>().ReverseMap();
            configuration.CreateMap<CollectBomManagerChild, BomDesignDetail>().ReverseMap();
            configuration.CreateMap<BomDesignDetail, CollectBomManagerChild>().ReverseMap();
            configuration.CreateMap<PrintLoadEntityDto, LoadPieceEntity>().ReverseMap();
            configuration.CreateMap<LoadPieceEntity, PrintLoadEntityDto>().ReverseMap();
            #endregion
            //编码规则
            configuration.CreateMap<CodeFormatDesc, CodeFormatDto>().ReverseMap();
            configuration.CreateMap<CodeFormatRecord, CodeFormatRecordDto>().ReverseMap();

            //人员技能矩阵
            configuration.CreateMap<UserSkill, UserSkillDto>().ReverseMap();

            //时间设置
            configuration.CreateMap<CalendarSetting, CalendarSettingDto>().ReverseMap();
            configuration.CreateMap<CalendarSettingRecord, CalendarSettingRecordDto>().ReverseMap();
            configuration.CreateMap<ClassSetting, ClassSettingDto>().ReverseMap();

            //异常建模
            configuration.CreateMap<RoleManager, RoleNameListDto>().ReverseMap();
            configuration.CreateMap<OrganizationUnit, OrganizationUnitsListDto>().ReverseMap();
            configuration.CreateMap<InspectionItemInfo, InspectionItemInfoOutDto>().ReverseMap();
            configuration.CreateMap<InspectionTypeDesc, InspectionTypeDescDto>().ReverseMap();
            configuration.CreateMap<InspectionSeverityDesc, InspectionSeverityDescOutDto>().ReverseMap();
            configuration.CreateMap<InspectionStandardDesc, InspectionStandardDescOutDto>().ReverseMap();
            //异常管理
            configuration.CreateMap<InspectionStandardDesc, InspectionDistributionlistDto>().ReverseMap();
            //图片上传
            configuration.CreateMap<UploadPicture, InspectionFileUploadDto>().ReverseMap();

            //质量建模
            configuration.CreateMap<QualityItemInfo, QualityItemInfoOutDto>().ReverseMap();
            configuration.CreateMap<QualityTypeDesc, QualityTypeDescDto>().ReverseMap();
            configuration.CreateMap<QualitySeverityDesc, QualitySeverityDescOutDto>().ReverseMap();

            //工艺路线
            configuration.CreateMap<ProcessTaskDto, BopDesc>().ReverseMap();
            configuration.CreateMap<BopDesc, ProcessTaskDto>().ReverseMap();
            configuration.CreateMap<ProcessLine, ProcessLineDto>().ReverseMap();
            configuration.CreateMap<ProcessLineDto, ProcessLine>().ReverseMap();
            configuration.CreateMap<ProcessNodeDto, ProcessLine>().ForMember(d => d.Id, opt => opt.MapFrom(s => s.Key));
            configuration.CreateMap<ProcessNodeDto, BopDesc>().ForMember(d => d.Id, opt => opt.MapFrom(s => s.Key));
            configuration.CreateMap<ProcessNodeDto, BopNode>().ForMember(d => d.Id, opt => opt.MapFrom(s => s.Key)).ForMember(d => d.NodeName, opt => opt.MapFrom(s => s.Text));
            configuration.CreateMap<ProcessNodeDto, ProcessesEntity>().ForMember(d => d.ProcessesName, opt => opt.MapFrom(s => s.Text))
            .ForMember(d => d.ProcessesWorking, opt => opt.MapFrom(s => s.WorkingHour)).ForMember(d => d.Id, opt => opt.MapFrom(s => s.Key));
            configuration.CreateMap<ProcessNodeDto, WorkStepEntity>().ForMember(d => d.WorkStepWorking, opt => opt.MapFrom(s => s.WorkingHour)).ForMember(d => d.Id, opt => opt.MapFrom(s => s.Key));
            configuration.CreateMap<BopDesc, ProcessNodeDto>().ForMember(d => d.Key, opt => opt.MapFrom(s => s.Id));
            configuration.CreateMap<BopNode, ProcessNodeDto>().ForMember(d => d.Key, opt => opt.MapFrom(s => s.Id)).ForMember(d => d.Text, opt => opt.MapFrom(s => s.NodeName));
            configuration.CreateMap<ProcessesEntity, ProcessNodeDto>().ForMember(d => d.Text, opt => opt.MapFrom(s => s.ProcessesName))
            .ForMember(d => d.WorkingHour, opt => opt.MapFrom(s => s.ProcessesWorking)).ForMember(d => d.Key, opt => opt.MapFrom(s => s.Id)).ForMember(d => d.Characteristic, opt => opt.MapFrom(s => s.ProcessesCharacteristic));
            configuration.CreateMap<WorkStepEntity, ProcessNodeDto>().ForMember(d => d.Text, opt => opt.MapFrom(s => s.WorkStepNumber.ToString()))
           .ForMember(d => d.WorkingHour, opt => opt.MapFrom(s => s.WorkStepWorking)).ForMember(d => d.Key, opt => opt.MapFrom(s => s.Id)).ForMember(d => d.Characteristic, opt => opt.MapFrom(s => s.WorkStepCharacteristic));
            //消息设置
            configuration.CreateMap<AffairRemindDto, AffairRemind>().ReverseMap();
            configuration.CreateMap<AffairRemind, AffairRemindDto>().ReverseMap();
            configuration.CreateMap<AffairMessage, AffairMessageDto>().ForMember(d => d.ReadStateDesc, opt => opt.MapFrom(s => GetEnumDesc(s.ReadState)));
            //审批流
            configuration.CreateMap<WorkFlowDto, WokFlow>().ReverseMap();
            configuration.CreateMap<WorkNode, WorkFlowNode>().ReverseMap();
            configuration.CreateMap<WorkFlowNode, WorkNode>().ReverseMap();
            configuration.CreateMap<WokFlow, WorkFlowDto>().ReverseMap();
            configuration.CreateMap<WorkAuditor, WorkAuditorDto>().ReverseMap();
            configuration.CreateMap<WorkAuditorDto, WorkAuditor>().ReverseMap();

            // configuration.CreateMap<BusinessApplicationDto, BusinessApplication>().ReverseMap();
            //configuration.CreateMap<ModifyManageDto, ModifyManage>().ReverseMap();
            // configuration.CreateMap<BusinessApplication, BusinessApplicationDto>().ForMember(d => d.ApprovalDesc, opt => opt.MapFrom(s => GetEnumDesc(s.ApprovalDesc)));
            //configuration.CreateMap<ModifyManage, ModifyManageDto>().ReverseMap();
            //生产计划
            configuration.CreateMap<MakeTaskInput, MakeTask>().ReverseMap();
            configuration.CreateMap<ProductionAssignmentInput, ProductionAssignment>().ReverseMap();
            configuration.CreateMap<ProductionAssignment, ProductionAssignmentInput>().ForMember(d => d.AssignmentTypesDesc, opt => opt.MapFrom(s => GetEnumDesc(s.AssignmentTypes)));
            //生产任务
            configuration.CreateMap<MakeTask, ProductionTaskOutput>().ForMember(d => d.ProductingStatusDesc, opt => opt.MapFrom(s => GetEnumDesc(s.ProductingStatus)));
            configuration.CreateMap<MakeTaskInput, MakeTask>().ReverseMap();
            //计划报工
            configuration.CreateMap<ProductionScheduler, ProductionReportOutput>().ForMember(d => d.ProductingStatusDesc, opt => opt.MapFrom(s => GetEnumDesc(s.ProductingStatus)))
            .ForMember(d => d.ProductedStatusDesc, opt => opt.MapFrom(s => GetEnumDesc(s.ProductedStatus)));
            configuration.CreateMap<JobWorker, JobWorkerOut>().ReverseMap();
            configuration.CreateMap<ProductionScheduler, ProductionJobOutput>().ForMember(dest => dest.JobWorkers, opt => opt.Ignore());

            //变更管理
            configuration.CreateMap<CreateModifManageInput, ModifyManage>().ReverseMap();
            configuration.CreateMap<ModifyManage, ModifTechniqueDto>().ForMember(d => d.DocumentStatusDesc, opt => opt.MapFrom(s => GetEnumDesc(s.DocumentStatus)));
            configuration.CreateMap<ModifyProcessesDto, ProcessesEntity>().ReverseMap();
            configuration.CreateMap<ProductionScheduler, ProductionSchedulerOutput>().ForMember(d => d.ProductingStatusDesc, opt => opt.MapFrom(s => GetEnumDesc(s.ProductingStatus)));


          
         
            //设计相关
            #region 设计相关
            configuration.CreateMap<FormInfo, GetDingLiangExaminationFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<FormInfo, GetDingXingExaminationFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<FormInfo, GetMultiMediaExaminationFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<FormInfo, GetDingLiangAndMultiMediaDataDto>().ReverseMap();
            configuration.CreateMap<FormInfo, GetMomentRationExaminationFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<FormInfo, GetTestRationExaminationFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<FormInfo, GetElectricalConnectorFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<FormInfo, GetMaterialObjectFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<InstructionEntity, GetProductInfoDto>().ReverseMap();
            configuration.CreateMap<InstructionEntity, GetProductInfoOutputDto>().ReverseMap();
            configuration.CreateMap<FormInfo, GetFormInfoDto>().ReverseMap();
            configuration.CreateMap<DingLiangAndMultiMediaExaminationFormEntity, GetDingLiangAndMultiMediaDto>().ReverseMap();
            configuration.CreateMap<DingLiangExaminationFormEntity, GetDingLiangExaminationFormEntityDto>().ReverseMap();
            configuration.CreateMap<DingXingExaminationFormEntity, GetDingXingExaminationFormEntityDto>().ReverseMap();
            configuration.CreateMap<ElectricalConnectorFormEntity, GetElectricalConnectorFormEntityDto>().ReverseMap();
            configuration.CreateMap<FormInstructionRelation, GetFormInstructionRelationDto>().ReverseMap();
            configuration.CreateMap<MaterialObjectFormEntity, GetMaterialObjectFormEntityDto>().ReverseMap();
            configuration.CreateMap<MomentRationExaminationFormEntity, GetMomentRationExaminationFormEntityDto>().ReverseMap();
            configuration.CreateMap<MultiMediaExaminationFormEntity, GetMultiMediaExaminationFormEntityDto>().ReverseMap();


            configuration.CreateMap<TestRationExaminationFormEntity, GetTestRationExaminationFormEntityDto>().ReverseMap();
            configuration.CreateMap<FormRelationEntity, FormRelationDto>().ReverseMap();
            configuration.CreateMap<CreateFormRelationDto, FormRelationEntity>().ReverseMap();
            configuration.CreateMap<UpdateFormRelationDto, FormRelationEntity>().ReverseMap();
            configuration.CreateMap<FormColRelationEntity, FormColRelationDto>().ReverseMap();
            configuration.CreateMap<CreateFormColRelationDto, FormColRelationEntity>().ReverseMap();
            configuration.CreateMap<UpdateFormColRelationDto, FormColRelationEntity>().ReverseMap();

            configuration.CreateMap<DingLiangAndMultiMediaExaminationFormEntity, GetJSDingLiangAndMultiMediaDto>().ReverseMap();
            configuration.CreateMap<MultiMediaExaminationFormEntity, GetJSMultiMediaExaminationFormEntityDto>().ReverseMap();
            configuration.CreateMap<ElectricalConnectorFormEntity, GetJSElectricalConnectorFormEntityDto>().ReverseMap();

            configuration.CreateMap<FormInfo, RFormJsonInput>().ReverseMap();
            configuration.CreateMap<InstructionEntity, RProductInfoDto>().ReverseMap();
            configuration.CreateMap<DingLiangAndMultiMediaExaminationFormEntity, RDingLiangAndMultiMediaDto>().ReverseMap();
            configuration.CreateMap<DingLiangExaminationFormEntity, RDingLiangExaminationFormEntityDto>().ReverseMap();
            configuration.CreateMap<DingXingExaminationFormEntity, RDingXingExaminationFormEntityDto>().ReverseMap();
            configuration.CreateMap<ElectricalConnectorFormEntity, RElectricalConnectorFormEntityDto>().ReverseMap();
            //    configuration.CreateMap<FormInstructionRelation, RFormInstructionRelationDto>().ReverseMap();
            configuration.CreateMap<MaterialObjectFormEntity, RMaterialObjectFormEntityDto>().ReverseMap();
            configuration.CreateMap<MomentRationExaminationFormEntity, RMomentRationExaminationFormEntityDto>().ReverseMap();
            configuration.CreateMap<MultiMediaExaminationFormEntity, RMultiMediaExaminationFormEntityDto>().ReverseMap();
            configuration.CreateMap<TestRationExaminationFormEntity, RTestRationExaminationFormEntityDto>().ReverseMap();

            configuration.CreateMap<DingLiangAndMultiMediaExaminationFormEntity, RDingLiangAndMultiMediaDataDto>().ReverseMap();
            configuration.CreateMap<DingLiangExaminationFormEntity, RDingLiangExaminationFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<DingXingExaminationFormEntity, RDingXingExaminationFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<ElectricalConnectorFormEntity, RElectricalConnectorFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<MaterialObjectFormEntity, RMaterialObjectFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<MomentRationExaminationFormEntity, RMomentRationExaminationFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<MultiMediaExaminationFormEntity, RMultiMediaExaminationFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<TestRationExaminationFormEntity, RTestRationExaminationFormEntityDataDto>().ReverseMap();
            configuration.CreateMap<ElectricalConnectorFormEntity, ProductInfosDto>().ReverseMap();
            configuration.CreateMap<DingLiangAndMultiMediaExaminationFormEntity, ProductInfosDto>().ReverseMap();
            configuration.CreateMap<DingLiangExaminationFormEntity, ProductInfosDto>().ReverseMap();
            configuration.CreateMap<DingXingExaminationFormEntity, ProductInfosDto>().ReverseMap();
            configuration.CreateMap<MaterialObjectFormEntity, ProductInfosDto>().ReverseMap();
            configuration.CreateMap<MomentRationExaminationFormEntity, ProductInfosDto>().ReverseMap();
            configuration.CreateMap<MultiMediaExaminationFormEntity, ProductInfosDto>().ReverseMap();
            configuration.CreateMap<TestRationExaminationFormEntity, ProductInfosDto>().ReverseMap();
            //configuration.CreateMap<InstructionLog, InstructionLogDto>().ReverseMap();
            //configuration.CreateMap<MaterialObjectInfo, MaterialObjectInfoEditDto>().ReverseMap();
            //configuration.CreateMap<MaterialObjectInfoEditDto, MaterialObjectInfo>().ReverseMap();
            #endregion


        }
        /// <summary>
        /// 根据枚举获取枚举描述信息
        /// </summary>
        /// <param name="parm"></param>
        /// <returns></returns>
        public static String GetEnumDesc(System.Enum parm)
        {
            FieldInfo enumInfo = parm.GetType().GetField(parm.ToString());
            if (enumInfo == null)
            {
                return "";
            }
            DescriptionAttribute[] enumAttributes
                = (DescriptionAttribute[])enumInfo.GetCustomAttributes(typeof(DescriptionAttribute), false);
            if (enumAttributes.Length > 0)
            {
                return enumAttributes[0].Description;
            }
            return parm.ToString();
        }

    }
}
